<?php
	session_start();
	$id_user=$_SESSION["id_user"];
	$joke = $_POST["id_joke"];
	include("database.php");
	$requete = "
		UPDATE jokes
		SET  score_joke = score_joke + 1
		WHERE id_joke=$joke
	";
	
	mysql_query($requete);
	
	$insert= "
		INSERT INTO vote_user 
		VALUE ('',$id_user,$joke)
	";
	
	mysql_query($insert);
	header('Location: index.php');
	
?>
